package com.midian.action.mc.device;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Controller;

import com.midian.action.mc.common.AjaxAction;
import com.midian.common.annotation.FunctionAnnotationOverride;
import com.midian.model.device.Device;
import com.midian.service.device.IDeviceService;

/**
 * 设备号表Action
 * @author Mengfh
 *
 */
@Scope("prototype")
@Controller("deviceAction")
@FunctionAnnotationOverride(isAction = true, auth = "设备号表管理")
public class DeviceAction extends AjaxAction<Device> {
	/**设备号表实体*/
	private Device entity;
	/**设备号表实体列表*/
	private List<Device> rows;
	/**设备号表业务*/
	private IDeviceService deviceService;
	
	public Device getEntity() {
		return entity;
	}
	public void setEntity(Device entity) {
		this.entity = entity;
	}
	@Resource(name = "deviceService")
	public void setDeviceService(IDeviceService deviceService) {
		this.service = deviceService;
		this.deviceService = deviceService;
	}
	@Override
	protected Device dytEntity() {
		if(this.entity == null) {
			this.entity = new Device();
		}
		return getEntity();
	}
	@Override
	protected void dyEntity(Device t) {
		setEntity(t);
	}
	@Override
	public void setRows(List<Device> rows) {
		this.rows = rows;
	}
	@Override
	public List<Device> getRows() {
		return rows;
	}
}
